{% extends 'base.html' %}
{% block title %}详情{% endblock %}
{% block head %}
	<link rel="stylesheet" href="{{url_for('static', filename = 'css/detail.css')}}">
{% endblock %}
{% block main%}
	<h3 class="page_title">
	    {{conversation.title}}
	</h3>
	<p class="conversation-info">
	    <span class="author" style="margin-right:10px;">作者：{{conversation.author.username}}</span>
	    <span>时间: {{conversation.create_time}}</span>
	</p>
	<hr>

	<div class="comment-container">
	<p class="conversation-content">
		{{conversation.content}}
	</p>
	<hr>
	<h4 class="comment">评论:({{conversation.comments|length}})</h4>
	<form action="{{url_for('add_comment')}}" method="post">
    <div class="form-group">
        <input type="text" class="form-control" placeholder="发表一下我的看法..." name="comment">
	<input type="hidden" name="conversation_id" value="{{conversation.id}}">
    </div>

    <div class="form-group" style="text-align: right;">
        <button class="btn btn-primary">立即评论</button>
    </div>
</form>
<ul class="comment-list">
    {% for comment in conversation.comments %}
        <li>
            <div class="user-info">
                <img class = "avatar" src="{{url_for('static',filename = 'images/picture.png')}} "  alt="">
                <span class="username">{{comment.author.username}}</span>
		<span class="create-time">{{comment.create_time}}</span>
            </div>
            <p class="comment-content">{{comment.content}}</p>
        </li>
    {% endfor %}
</ul>
</div>

{% endblock %}
